<?php
namespace My\Controller;
use Utuo\BackgroundController;
class SeckillController extends  BackgroundController
{
	private $status = array(
			'0' => '关闭',
			'1' => '开启'
	);
	public function _initialize(){
		$this->setControllerTitle("一元秒杀管理");
		$this->setActionTitle(array(
			'index' => '一元秒杀',
			//'add' => '一元秒杀添加',
			//'modify' => '修改一元秒杀',
			//'recycle' => '回收站'
		));
		$this->setActionNav(array(
			'index',
			//'add',
			//'recycle'
		));
	}
	public function indexAction()
	{
	$seckill=D('Seckill')->find();
  	$seckill['statusRadio'] = $this->getRadio("status", $this->status, $seckill['status']);
  	$this->assign("seckill",$seckill)->display('save');
	}
	/* public function getLists($is_deleted){
		$m=M('Seckill');
		$condation=array(
			'is_deleted'=>$is_deleted
		);
		$seckill=$m->where($condation)->select();
		$count=$m->count();
        $this->showPage($count, $this->getPageSize());
        
		$this->assign("seckill", $seckill);
		$this->display();
	}
	public function addAction() {
		$seckill=array();
		$seckill['statusRadio'] = $this->getRadio("status", $this->status, 1);
        $seckill['begin_time']=time();
	    $seckill['end_time']=strtotime("+3 day");
	    $this->assign("seckill",$seckill);
	    $this->display("save");
	}
  public function modifyAction(){
  	$seckill=D('Seckill')->getOneById();
  	$seckill['statusRadio'] = $this->getRadio("status", $this->status, $seckill['status']);
  	$this->assign("seckill",$seckill)->display('save');
  } */
	
}